\section{model::dom Class Reference}
\label{classmodel_1_1dom}\index{model::dom@{model::dom}}
{\tt \#include $<$dom.h$>$}

\subsection*{Public Types}
\begin{CompactItemize}
\item 
typedef boost::shared\_\-ptr$<$ \bf{dom} $>$ \bf{ptr}\label{classmodel_1_1dom_ea5239efaf9985f82068cbdb70f5a954}

\item 
enum \bf{node\_\-type} 
\end{CompactItemize}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
\bf{dom} ()
\item 
\bf{dom} (const string \&name)
\item 
\bf{dom} (const \bf{dom} \&d)
\item 
\bf{$\sim$dom} ()
\item 
\bf{dom} \& \bf{operator=} (const \bf{dom} \&d)
\item 
const \bf{ptr} \bf{next} () const 
\item 
\bf{ptr} \bf{next} ()
\item 
const \bf{ptr} \bf{prev} () const 
\item 
\bf{ptr} \bf{prev} ()
\item 
const \bf{ptr} \bf{parent} () const 
\item 
\bf{ptr} \bf{parent} ()
\item 
const \bf{ptr} \bf{child} () const 
\item 
\bf{ptr} \bf{child} ()
\item 
const \bf{ptr} \bf{attrib} () const 
\item 
\bf{ptr} \bf{attrib} ()
\item 
const \bf{ptr} \bf{root} () const 
\item 
\bf{ptr} \bf{root} ()
\item 
const \bf{ptr} \bf{next\_\-tag} () const 
\item 
\bf{ptr} \bf{next\_\-tag} ()
\item 
const \bf{ptr} \bf{prev\_\-tag} () const 
\item 
\bf{ptr} \bf{prev\_\-tag} ()
\item 
const \bf{ptr} \bf{first\_\-tag} () const 
\item 
\bf{ptr} \bf{first\_\-tag} ()
\item 
\bf{node\_\-type} \bf{type} () const 
\item 
string \bf{name} () const 
\item 
string \bf{cdata} () const 
\item 
bool \bf{has\_\-children} () const 
\item 
bool \bf{has\_\-attribs} () const 
\item 
const \bf{ptr} \bf{find} (const string \&name) const 
\item 
\bf{ptr} \bf{find} (const string \&name)
\item 
const string \bf{find\_\-cdata} (const string \&name) const 
\item 
string \bf{find\_\-cdata} (const string \&name)
\item 
const string \bf{find\_\-attrib} (const string \&name) const 
\item 
string \bf{find\_\-attrib} (const string \&name)
\item 
const \bf{ptr} \bf{find\_\-with\_\-attrib} (const string \&tagname, const string \&attrname, const string \&val) const 
\item 
\bf{ptr} \bf{find\_\-with\_\-attrib} (const string \&tagname, const string \&attrname, const string \&val)
\item 
\bf{ptr} \bf{insert} (const string \&name)
\item 
\bf{ptr} \bf{insert\_\-cdata} (const string \&name)
\item 
\bf{ptr} \bf{insert\_\-attrib} (const string \&name, const string \&val)
\item 
\bf{ptr} \bf{insert\_\-node} (const \bf{dom} \&node)
\item 
void \bf{hide} ()
\item 
\bf{operator bool} () const 
\item 
string \bf{to\_\-string} () const 
\item 
bool \bf{save} (const string \&filename) const 
\item 
bool \bf{load} (const string \&filename)
\item 
void \bf{set\_\-managed} (bool managed)\label{classmodel_1_1dom_b56a6b98ffe3ee84ba57553bcdb0ea01}

\end{CompactItemize}
\subsection*{Friends}
\begin{CompactItemize}
\item 
class \bf{parser}\label{classmodel_1_1dom_8de78aa991dff0fc519d5c721ea49733}

\item 
class \bf{dom\_\-policy}\label{classmodel_1_1dom_6b2d6186e4034d3d14fbbd944f235059}

\end{CompactItemize}


\subsection{Detailed Description}
This class provides a DOM-interface for viewing and editing xml-files. \begin{Desc}
\item[Author:]Michael Opitz $<$\tt{opitz.michael@gmail.com}$>$ \end{Desc}
\begin{Desc}
\item[Version:]0.1 \end{Desc}




Definition at line 45 of file dom.h.

\subsection{Member Enumeration Documentation}
\index{model::dom@{model::dom}!node_type@{node\_\-type}}
\index{node_type@{node\_\-type}!model::dom@{model::dom}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}enum \bf{model::dom::node\_\-type}}\label{classmodel_1_1dom_1f2cfdb0b8561882c61b97e5b0e2e3c6}


This enum descripes the type of this node, which can either be a tag-node, a data-node, or a attribute. 

Definition at line 51 of file dom.h.

\begin{Code}\begin{verbatim}51 {TAG, CDATA, ATTRIBUTE};
\end{verbatim}\end{Code}




\subsection{Constructor \& Destructor Documentation}
\index{model::dom@{model::dom}!dom@{dom}}
\index{dom@{dom}!model::dom@{model::dom}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}model::dom::dom ()}\label{classmodel_1_1dom_3634afe661d9b09ccac1d685661b93fd}


The standard-constructor initialises a empty node. 

Definition at line 3 of file dom.cpp.

\begin{Code}\begin{verbatim}4 :node(0), is_managed(true)
5 {
6 
7 }
\end{verbatim}\end{Code}


\index{model::dom@{model::dom}!dom@{dom}}
\index{dom@{dom}!model::dom@{model::dom}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}model::dom::dom (const string \& {\em name})}\label{classmodel_1_1dom_491d9c91a8ad974d538a1a639c3b3812}


This constructor parses the xml-information, which is included in the string and stores it into this object. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em name}]is an xml-string, which should be parsed. \end{description}
\end{Desc}


Definition at line 9 of file dom.cpp.

\begin{Code}\begin{verbatim}10 : is_managed(false)
11 {
12         node = iks_new(name.c_str());
13 }
\end{verbatim}\end{Code}


\index{model::dom@{model::dom}!dom@{dom}}
\index{dom@{dom}!model::dom@{model::dom}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}model::dom::dom (const \bf{dom} \& {\em d})}\label{classmodel_1_1dom_3b67afcc5bed910e0b6a78131e282956}


This is the copy-constructor, which makes a deep-copy of the dom-information. 

Definition at line 22 of file dom.cpp.

\begin{Code}\begin{verbatim}23 {
24         if(d.get()) {
25                 is_managed = false;
26                 node = iks_copy(d.node);
27         } else {
28                 node = 0;
29         }
30 }
\end{verbatim}\end{Code}


\index{model::dom@{model::dom}!~dom@{$\sim$dom}}
\index{~dom@{$\sim$dom}!model::dom@{model::dom}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}model::dom::$\sim$dom ()}\label{classmodel_1_1dom_be3e8d2e3c297d128533c9b9eb7c68bf}


The destructor frees the allocated memory. 

Definition at line 15 of file dom.cpp.

\begin{Code}\begin{verbatim}16 {
17         if(node != 0 && !is_managed) {
18                 iks_delete(node);
19         }
20 }
\end{verbatim}\end{Code}




\subsection{Member Function Documentation}
\index{model::dom@{model::dom}!attrib@{attrib}}
\index{attrib@{attrib}!model::dom@{model::dom}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\bf{model::dom::ptr} model::dom::attrib ()}\label{classmodel_1_1dom_6f75dad0440aa5938c6071d166e5293f}


This method returns a pointer to the attributes of the current node. \begin{Desc}
\item[Returns:]A pointer to a dom-object is returned. \end{Desc}


Definition at line 84 of file dom.cpp.

\begin{Code}\begin{verbatim}85 {
86         if(node != 0) {
87                 iks *tmp = iks_attrib(node);
88                 return get_ptr(tmp);
89         }
90         return get_empty_ptr();
91 }
\end{verbatim}\end{Code}


\index{model::dom@{model::dom}!attrib@{attrib}}
\index{attrib@{attrib}!model::dom@{model::dom}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}const \bf{ptr} model::dom::attrib () const\hspace{0.3cm}{\tt  [inline]}}\label{classmodel_1_1dom_a9f15c036af54bdbb7fecc6a5796d9d6}


This method returns a pointer to the attributes of the current node. \begin{Desc}
\item[Returns:]A pointer to a dom-object is returned. \end{Desc}


Definition at line 144 of file dom.h.

\begin{Code}\begin{verbatim}144                                          {return static_cast<const ptr>(
145                                 const_cast<dom*>(this)->attrib());}
\end{verbatim}\end{Code}


\index{model::dom@{model::dom}!cdata@{cdata}}
\index{cdata@{cdata}!model::dom@{model::dom}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}string model::dom::cdata () const}\label{classmodel_1_1dom_6c5832269b3221c244fa5dc0438f6a9b}


This method returns the node's data. \begin{Desc}
\item[Returns:]A string is returned by this method. If there is no data in the string, the method returns an empty string. \end{Desc}


Definition at line 159 of file dom.cpp.

\begin{Code}\begin{verbatim}160 {
161         if(node != 0) {
162                 string str = iks_cdata(node);
163                 return str;
164         }
165         return "";
166 }
\end{verbatim}\end{Code}


\index{model::dom@{model::dom}!child@{child}}
\index{child@{child}!model::dom@{model::dom}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\bf{model::dom::ptr} model::dom::child ()}\label{classmodel_1_1dom_bca1fd75a99af84ca427bcf045a7b280}


This method returns a pointer to the child-element of this node. \begin{Desc}
\item[Returns:]A pointer to a dom-object is returned. \end{Desc}


Definition at line 75 of file dom.cpp.

\begin{Code}\begin{verbatim}76 {
77         if(node != 0) {
78                 iks *tmp = iks_child(node);
79                 return get_ptr(tmp);
80         }
81         return get_empty_ptr();
82 }
\end{verbatim}\end{Code}


\index{model::dom@{model::dom}!child@{child}}
\index{child@{child}!model::dom@{model::dom}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}const \bf{ptr} model::dom::child () const\hspace{0.3cm}{\tt  [inline]}}\label{classmodel_1_1dom_d23d8d7912713002f86ad9ef90cfd6ad}


This method returns a pointer to the child-element of this node. \begin{Desc}
\item[Returns:]A pointer to a dom-object is returned. \end{Desc}


Definition at line 130 of file dom.h.

\begin{Code}\begin{verbatim}130                                         {return static_cast<const ptr>(
131                                 const_cast<dom*>(this)->child());}
\end{verbatim}\end{Code}


\index{model::dom@{model::dom}!find@{find}}
\index{find@{find}!model::dom@{model::dom}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\bf{model::dom::ptr} model::dom::find (const string \& {\em name})}\label{classmodel_1_1dom_3ef1a1808488081fc1a07973ec1a0f82}


This method searches the dom-tree for TAG-nodes \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em name}]is the search pattern \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]If there exists a matching TAG-node within the tree a pointer to the node will be returned. If there are no TAG-nodes a pointer to an empty dom-object will be returned. \end{Desc}


Definition at line 184 of file dom.cpp.

\begin{Code}\begin{verbatim}185 {
186         if(node != 0) {
187                 return get_ptr(iks_find(node, name.c_str()));
188         }
189         return get_empty_ptr();
190 }
\end{verbatim}\end{Code}


\index{model::dom@{model::dom}!find@{find}}
\index{find@{find}!model::dom@{model::dom}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}const \bf{ptr} model::dom::find (const string \& {\em name}) const\hspace{0.3cm}{\tt  [inline]}}\label{classmodel_1_1dom_a4f153802be6cd5caee04d8a6e9c06ee}


This method searches the dom-tree for TAG-nodes, which names are matched by the passed parameter. \begin{Desc}
\item[Returns:]If there exists a matching TAG-node within the tree a pointer to the node will be returned. If there are no TAG-nodes a pointer to an empty dom-object will be returned. \end{Desc}


Definition at line 252 of file dom.h.

\begin{Code}\begin{verbatim}252                                                          {return static_cast
253                         <const ptr>(const_cast<dom*>(this)->find(name));}
\end{verbatim}\end{Code}


\index{model::dom@{model::dom}!find_attrib@{find\_\-attrib}}
\index{find_attrib@{find\_\-attrib}!model::dom@{model::dom}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}string model::dom::find\_\-attrib (const string \& {\em name})}\label{classmodel_1_1dom_7011d8e13a728b9815fd9faaf545ef84}


This method searches the dom-tree for an attribute. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em name}]is the attribute name. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]If the attribute is found, the value is returned, if not an empty string is returned. \end{Desc}


Definition at line 203 of file dom.cpp.

\begin{Code}\begin{verbatim}204 {
205         if(node != 0) {
206                 char *tmp = iks_find_attrib(node, name.c_str());
207                 if(!tmp) {
208                         return "";
209                 }
210                 return tmp;
211         }
212         return "";
213 }
\end{verbatim}\end{Code}


\index{model::dom@{model::dom}!find_attrib@{find\_\-attrib}}
\index{find_attrib@{find\_\-attrib}!model::dom@{model::dom}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}const string model::dom::find\_\-attrib (const string \& {\em name}) const\hspace{0.3cm}{\tt  [inline]}}\label{classmodel_1_1dom_80d3533dff0941de3f7a5fdac3edeb31}


This method searches the dom-tree for an attribute. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em name}]is the attribute name. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]If the attribute is found, the value is returned, if not an empty string is returned. \end{Desc}


Definition at line 288 of file dom.h.

\begin{Code}\begin{verbatim}288                                                                    {return 
289                         static_cast <const string>
290                                 (const_cast<dom*>(this)->find_attrib(name));}
\end{verbatim}\end{Code}


\index{model::dom@{model::dom}!find_cdata@{find\_\-cdata}}
\index{find_cdata@{find\_\-cdata}!model::dom@{model::dom}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}string model::dom::find\_\-cdata (const string \& {\em name})}\label{classmodel_1_1dom_dcc85dd89fabd32fbb335db80a207a6e}


This method searches the dom-tree for CDATA-nodes. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em name}]is the search pattern. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]If there was a matching CDATA-node found within the tree, the CDATA will be returned within a string. If not there will be an empty string returned. \end{Desc}


Definition at line 192 of file dom.cpp.

\begin{Code}\begin{verbatim}193 {
194         if(node != 0) {
195                 const char *tmp = iks_find_cdata(node, name.c_str());
196                 if(tmp != 0) {
197                         return tmp;
198                 }
199         }
200         return "";
201 }
\end{verbatim}\end{Code}


\index{model::dom@{model::dom}!find_cdata@{find\_\-cdata}}
\index{find_cdata@{find\_\-cdata}!model::dom@{model::dom}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}const string model::dom::find\_\-cdata (const string \& {\em name}) const\hspace{0.3cm}{\tt  [inline]}}\label{classmodel_1_1dom_0230c009817b5f3a879bf34bbd1086ea}


This method searches the dom-tree for CDATA-nodes. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em name}]is the search pattern. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]If there was a matching CDATA-node found within the tree, the CDATA will be returned within a string. If not there will be an empty string returned. \end{Desc}


Definition at line 270 of file dom.h.

\begin{Code}\begin{verbatim}270                                                                   {return 
271                         static_cast <const string>
272                                 (const_cast<dom*>(this)->find_cdata(name));}
\end{verbatim}\end{Code}


\index{model::dom@{model::dom}!find_with_attrib@{find\_\-with\_\-attrib}}
\index{find_with_attrib@{find\_\-with\_\-attrib}!model::dom@{model::dom}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\bf{model::dom::ptr} model::dom::find\_\-with\_\-attrib (const string \& {\em tagname}, const string \& {\em attrname}, const string \& {\em val})}\label{classmodel_1_1dom_eba5442ca22f76355787e2b4063e6445}


This method searches the dom-tree for a node. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em tagname}]is the tagname of the node. \item[{\em attrname}]is the name of an node's attribute. \item[{\em val}]is the value of the node's attribute. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]If the node is found a pointer to the node is returned, otherwise a pointer to an empty node is returned. \end{Desc}


Definition at line 215 of file dom.cpp.

\begin{Code}\begin{verbatim}217 {
218         if(node != 0) {
219                 return get_ptr(iks_find_with_attrib(node, tagname.c_str(),
220                                         attrname.c_str(), val.c_str()));
221         }
222         return get_empty_ptr();
223 }
\end{verbatim}\end{Code}


\index{model::dom@{model::dom}!find_with_attrib@{find\_\-with\_\-attrib}}
\index{find_with_attrib@{find\_\-with\_\-attrib}!model::dom@{model::dom}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}const \bf{ptr} model::dom::find\_\-with\_\-attrib (const string \& {\em tagname}, const string \& {\em attrname}, const string \& {\em val}) const\hspace{0.3cm}{\tt  [inline]}}\label{classmodel_1_1dom_b2df99f6c456d3d4bba826963e25c014}


This method searches the dom-tree for a node. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em tagname}]is the tagname of the node. \item[{\em attrname}]is the name of an node's attribute. \item[{\em val}]is the value of the node's attribute. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]If the node is found a pointer to the node is returned, otherwise a pointer to an empty node is returned. \end{Desc}


Definition at line 307 of file dom.h.

\begin{Code}\begin{verbatim}309                 {
310                         return static_cast<const ptr>(const_cast<dom*>
311                                 (this)->find_with_attrib(tagname, attrname, 
312                                                          val));
313                 }
\end{verbatim}\end{Code}


\index{model::dom@{model::dom}!first_tag@{first\_\-tag}}
\index{first_tag@{first\_\-tag}!model::dom@{model::dom}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\bf{model::dom::ptr} model::dom::first\_\-tag ()}\label{classmodel_1_1dom_ba63fad5bdb1b320b48770074f1b43a7}


This method returns a pointer to the first tag of the dom-tree. Only tag nodes are considered and other types of the nodes are skipped. \begin{Desc}
\item[Returns:]A pointer to a dom-object is returned. \end{Desc}


Definition at line 120 of file dom.cpp.

\begin{Code}\begin{verbatim}121 {
122         if(node != 0) {
123                 iks *tmp = iks_first_tag(node);
124                 return get_ptr(tmp);
125         }
126         return get_empty_ptr();
127 }
\end{verbatim}\end{Code}


\index{model::dom@{model::dom}!first_tag@{first\_\-tag}}
\index{first_tag@{first\_\-tag}!model::dom@{model::dom}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}const \bf{ptr} model::dom::first\_\-tag () const\hspace{0.3cm}{\tt  [inline]}}\label{classmodel_1_1dom_aa40f464a484488b115f48f1c524f28b}


This method returns a pointer to the first tag of the dom-tree. Only tag nodes are considered and other types of the nodes are skipped. \begin{Desc}
\item[Returns:]A pointer to a dom-object is returned. \end{Desc}


Definition at line 205 of file dom.h.

\begin{Code}\begin{verbatim}205                                             {return static_cast<const ptr>(
206                                 const_cast<dom*>(this)->first_tag());}
\end{verbatim}\end{Code}


\index{model::dom@{model::dom}!has_attribs@{has\_\-attribs}}
\index{has_attribs@{has\_\-attribs}!model::dom@{model::dom}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool model::dom::has\_\-attribs () const}\label{classmodel_1_1dom_c7fb58647b66b84a146b11e2e93dca56}


This method returns true if there are any attributes in the node. \begin{Desc}
\item[Returns:]True is returned if there are any attributes in the node. \end{Desc}


Definition at line 176 of file dom.cpp.

\begin{Code}\begin{verbatim}177 {
178         if(node != 0) {
179                 return iks_has_attribs(node);
180         }
181         return false;
182 }
\end{verbatim}\end{Code}


\index{model::dom@{model::dom}!has_children@{has\_\-children}}
\index{has_children@{has\_\-children}!model::dom@{model::dom}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool model::dom::has\_\-children () const}\label{classmodel_1_1dom_9b96fb70721896bb58b1de928f7b3085}


This method returns true if the node has child-nodes. \begin{Desc}
\item[Returns:]This method returns true if the node has child-nodes. \end{Desc}


Definition at line 168 of file dom.cpp.

\begin{Code}\begin{verbatim}169 {
170         if(node != 0) {
171                 return iks_has_children(node);
172         }
173         return false;
174 }
\end{verbatim}\end{Code}


\index{model::dom@{model::dom}!hide@{hide}}
\index{hide@{hide}!model::dom@{model::dom}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void model::dom::hide ()}\label{classmodel_1_1dom_a12c44aa662a44a5c177d28a68a348b8}


Changes the links of the other nodes so that this node becomes invisible. 

Definition at line 259 of file dom.cpp.

\begin{Code}\begin{verbatim}260 {
261         if(node != 0) {
262                 iks_hide(node);
263         }
264 }
\end{verbatim}\end{Code}


\index{model::dom@{model::dom}!insert@{insert}}
\index{insert@{insert}!model::dom@{model::dom}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\bf{model::dom::ptr} model::dom::insert (const string \& {\em name})}\label{classmodel_1_1dom_1032eec65a5e8bccdf0ff28a72c19363}


This method inserts a TAG-type node with the passed tag-name. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em name}]is the name of the new tag, which will be created \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]The node-pointer is returned. \end{Desc}


Definition at line 225 of file dom.cpp.

\begin{Code}\begin{verbatim}226 {
227         if(node != 0) {
228                 return get_ptr(iks_insert(node, name.c_str()));
229         }
230         return get_empty_ptr();
231 }
\end{verbatim}\end{Code}


\index{model::dom@{model::dom}!insert_attrib@{insert\_\-attrib}}
\index{insert_attrib@{insert\_\-attrib}!model::dom@{model::dom}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\bf{model::dom::ptr} model::dom::insert\_\-attrib (const string \& {\em name}, const string \& {\em val})}\label{classmodel_1_1dom_13d433ee197e2f1bd79f55322e692c1c}


This method inserts a new attribute with value in the node. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em name}]ist the name of the attribute. \item[{\em val}]is the value of the attribute. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]A pointer to the dom-node is be returned. \end{Desc}


Definition at line 242 of file dom.cpp.

\begin{Code}\begin{verbatim}243 {
244         if(node != 0) {
245                 return get_ptr(iks_insert_attrib(node, name.c_str(),
246                                         val.c_str()));
247         }
248         return get_empty_ptr();
249 }
\end{verbatim}\end{Code}


\index{model::dom@{model::dom}!insert_cdata@{insert\_\-cdata}}
\index{insert_cdata@{insert\_\-cdata}!model::dom@{model::dom}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\bf{model::dom::ptr} model::dom::insert\_\-cdata (const string \& {\em name})}\label{classmodel_1_1dom_4cafe4044e571c7b4d7209b81dc420bc}


This method inserts a CDATA-type node. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em name}]is the data, which should be inserted in the node \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]A pointer to the node will be returned. \end{Desc}


Definition at line 233 of file dom.cpp.

\begin{Code}\begin{verbatim}234 {
235         if(node != 0) {
236                 return get_ptr(iks_insert_cdata(node, name.c_str(),
237                                         name.size()));
238         }
239         return get_empty_ptr();
240 }
\end{verbatim}\end{Code}


\index{model::dom@{model::dom}!insert_node@{insert\_\-node}}
\index{insert_node@{insert\_\-node}!model::dom@{model::dom}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\bf{model::dom::ptr} model::dom::insert\_\-node (const \bf{dom} \& {\em node})}\label{classmodel_1_1dom_b4bd428f439e97be7210fe47d2db3508}


This method inserts a dom-tree. The nodes are not, deep-copied, so that you must be carefully. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em node}]is the node which should be inserted. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]A pointer to the node is be returned. \end{Desc}


Definition at line 251 of file dom.cpp.

\begin{Code}\begin{verbatim}252 {
253         if(d.node != 0 && node != 0) {
254                 return get_ptr(iks_insert_node(node, d.node));
255         }
256         return get_empty_ptr();
257 }
\end{verbatim}\end{Code}


\index{model::dom@{model::dom}!load@{load}}
\index{load@{load}!model::dom@{model::dom}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool model::dom::load (const string \& {\em filename})}\label{classmodel_1_1dom_1f98febac8bc82c607321d3800fb41b4}


Loads the dom-tree from a file. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em filename}]is the file, from which the tree should be loaded. \end{description}
\end{Desc}


Definition at line 304 of file dom.cpp.

\begin{Code}\begin{verbatim}305 {
306         if(!is_managed) {
307                 iks_delete(node);
308         }
309         is_managed = false;
310         return iks_load(filename.c_str(), &node) == IKS_OK;
311 }
\end{verbatim}\end{Code}


\index{model::dom@{model::dom}!name@{name}}
\index{name@{name}!model::dom@{model::dom}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}string model::dom::name () const}\label{classmodel_1_1dom_9065eb8e2989b910005abce37cd024bb}


This method returns the name of the tag for nodes with the type TAG. \begin{Desc}
\item[Returns:]A string with the name is returned. \end{Desc}


Definition at line 150 of file dom.cpp.

\begin{Code}\begin{verbatim}151 {
152         if(node != 0) {
153                 string str = iks_name(node);
154                 return str;
155         }
156         return "";
157 }
\end{verbatim}\end{Code}


\index{model::dom@{model::dom}!next@{next}}
\index{next@{next}!model::dom@{model::dom}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\bf{model::dom::ptr} model::dom::next ()}\label{classmodel_1_1dom_a022d8b08daf36b2c02b9d42bfbb2081}


This method returns a pointer of the next element in the dom-tree \begin{Desc}
\item[Returns:]A pointer to a dom-object is returned. \end{Desc}


Definition at line 48 of file dom.cpp.

\begin{Code}\begin{verbatim}49 {
50         if(node != 0) {
51                 iks *tmp = iks_next(node);
52                 return get_ptr(tmp);
53         }
54         return get_empty_ptr();
55 }
\end{verbatim}\end{Code}


\index{model::dom@{model::dom}!next@{next}}
\index{next@{next}!model::dom@{model::dom}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}const \bf{ptr} model::dom::next () const\hspace{0.3cm}{\tt  [inline]}}\label{classmodel_1_1dom_817bf7973099c476e5f07cee3b95d91f}


This method returns a pointer of the next element in the dom-tree \begin{Desc}
\item[Returns:]A pointer to a dom-object is returned. \end{Desc}


Definition at line 88 of file dom.h.

\begin{Code}\begin{verbatim}88                                        {return static_cast<const ptr>(
89                                 const_cast<dom*>(this)->next());}
\end{verbatim}\end{Code}


\index{model::dom@{model::dom}!next_tag@{next\_\-tag}}
\index{next_tag@{next\_\-tag}!model::dom@{model::dom}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\bf{model::dom::ptr} model::dom::next\_\-tag ()}\label{classmodel_1_1dom_c96a690569bcf6cd2ef0b69955be8b6c}


This method returns a pointer to the next tag-element of the dom-tree. Only tag nodes are considered and other types of the nodes are skipped. \begin{Desc}
\item[Returns:]A pointer to a dom-object is returned. \end{Desc}


Definition at line 102 of file dom.cpp.

\begin{Code}\begin{verbatim}103 {
104         if(node != 0) {
105                 iks *tmp = iks_next_tag(node);
106                 return get_ptr(tmp);
107         }
108         return get_empty_ptr();
109 }
\end{verbatim}\end{Code}


\index{model::dom@{model::dom}!next_tag@{next\_\-tag}}
\index{next_tag@{next\_\-tag}!model::dom@{model::dom}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}const \bf{ptr} model::dom::next\_\-tag () const\hspace{0.3cm}{\tt  [inline]}}\label{classmodel_1_1dom_3446bbe0eb6ff6b7f62fe052652db5aa}


This method returns a pointer to the next tag-element of the dom-tree. Only tag nodes are considered and other types or the nodes are skipped. \begin{Desc}
\item[Returns:]A pointer to a dom-object is returned. \end{Desc}


Definition at line 173 of file dom.h.

\begin{Code}\begin{verbatim}173                                            {return static_cast<const ptr>(
174                                 const_cast<dom*>(this)->next_tag());}
\end{verbatim}\end{Code}


\index{model::dom@{model::dom}!operator bool@{operator bool}}
\index{operator bool@{operator bool}!model::dom@{model::dom}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}model::dom::operator bool () const}\label{classmodel_1_1dom_5edc19f9c9fb4e88b7fe5589ed4b0788}


This method checks if the dom-object is empty. Empty nodes are returned by methods like \doxyref{next()}{p.}{classmodel_1_1dom_a022d8b08daf36b2c02b9d42bfbb2081}; if there are no following elements in the dom-tree. 

Definition at line 278 of file dom.cpp.

\begin{Code}\begin{verbatim}279 {
280         return node != 0;
281 }
\end{verbatim}\end{Code}


\index{model::dom@{model::dom}!operator=@{operator=}}
\index{operator=@{operator=}!model::dom@{model::dom}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\bf{model::dom} \& model::dom::operator= (const \bf{dom} \& {\em d})}\label{classmodel_1_1dom_104881cffb70f8a3b2d6d233a769f12e}


The assign-operator makes a deep-copy of the dom-information. 

Definition at line 32 of file dom.cpp.

\begin{Code}\begin{verbatim}33 {
34         if(this == &d) {
35                 return *this;
36         }
37         if(node && !is_managed) {
38                 iks_delete(node);
39         }
40         if(d.node) {
41                 is_managed = false;
42                 node = iks_copy(d.node);
43         } else {
44                 node = 0;
45         }
46 }
\end{verbatim}\end{Code}


\index{model::dom@{model::dom}!parent@{parent}}
\index{parent@{parent}!model::dom@{model::dom}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\bf{model::dom::ptr} model::dom::parent ()}\label{classmodel_1_1dom_278bab9f18335ba54c93979f484350a1}


This method retunrs a pointer to the parent-element in the dom-tree. \begin{Desc}
\item[Returns:]A pointer to a dom-object is returned. \end{Desc}


Definition at line 66 of file dom.cpp.

\begin{Code}\begin{verbatim}67 {
68         if(node != 0) {
69                 iks *tmp = iks_parent(node);
70                 return get_ptr(tmp);
71         }
72         return get_empty_ptr();
73 }
\end{verbatim}\end{Code}


\index{model::dom@{model::dom}!parent@{parent}}
\index{parent@{parent}!model::dom@{model::dom}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}const \bf{ptr} model::dom::parent () const\hspace{0.3cm}{\tt  [inline]}}\label{classmodel_1_1dom_82e663a4096c6f019d2a31b3e41ead3a}


This method retunrs a pointer to the parent-element in the dom-tree. \begin{Desc}
\item[Returns:]A pointer to a dom-object is returned. \end{Desc}


Definition at line 116 of file dom.h.

\begin{Code}\begin{verbatim}116                                          {return static_cast<const ptr>(
117                                 const_cast<dom*>(this)->parent());}
\end{verbatim}\end{Code}


\index{model::dom@{model::dom}!prev@{prev}}
\index{prev@{prev}!model::dom@{model::dom}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\bf{model::dom::ptr} model::dom::prev ()}\label{classmodel_1_1dom_ca893784ee9b349b4d7f5bc6aef2cde9}


This method returns a pointer of the previouse element in the dom-tree. \begin{Desc}
\item[Returns:]A pointer to a dom-object is returned. \end{Desc}


Definition at line 57 of file dom.cpp.

\begin{Code}\begin{verbatim}58 {
59         if(node != 0) {
60                 iks *tmp = iks_prev(node);
61                 return get_ptr(tmp);
62         }
63         return get_empty_ptr();
64 }
\end{verbatim}\end{Code}


\index{model::dom@{model::dom}!prev@{prev}}
\index{prev@{prev}!model::dom@{model::dom}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}const \bf{ptr} model::dom::prev () const\hspace{0.3cm}{\tt  [inline]}}\label{classmodel_1_1dom_06413647891968e9162c170408a362a4}


This method returns a pointer of the previouse element in the dom-tree. \begin{Desc}
\item[Returns:]A pointer to a dom-object is returned. \end{Desc}


Definition at line 102 of file dom.h.

\begin{Code}\begin{verbatim}102                                        {return static_cast<const ptr>(
103                                 const_cast<dom*>(this)->prev());}
\end{verbatim}\end{Code}


\index{model::dom@{model::dom}!prev_tag@{prev\_\-tag}}
\index{prev_tag@{prev\_\-tag}!model::dom@{model::dom}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\bf{model::dom::ptr} model::dom::prev\_\-tag ()}\label{classmodel_1_1dom_67096b00bc8c5d599299b8a39590a44b}


This method returns a pointer to the previouse tag-element of the dom-tree. Only tag nodes are considered and other types of the nodes are skipped. \begin{Desc}
\item[Returns:]A pointer to a dom-object is returned. \end{Desc}


Definition at line 111 of file dom.cpp.

\begin{Code}\begin{verbatim}112 {
113         if(node != 0) {
114                 iks *tmp = iks_prev_tag(node);
115                 return get_ptr(tmp);
116         }
117         return get_empty_ptr();
118 }
\end{verbatim}\end{Code}


\index{model::dom@{model::dom}!prev_tag@{prev\_\-tag}}
\index{prev_tag@{prev\_\-tag}!model::dom@{model::dom}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}const \bf{ptr} model::dom::prev\_\-tag () const\hspace{0.3cm}{\tt  [inline]}}\label{classmodel_1_1dom_3deea37050a75de2b4747df118ba4f77}


This method returns a pointer to the previouse tag-element of the dom-tree. Only tag nodes are considered and other types of the nodes are skipped. \begin{Desc}
\item[Returns:]A pointer to a dom-object is returned. \end{Desc}


Definition at line 189 of file dom.h.

\begin{Code}\begin{verbatim}189                                            {return static_cast<const ptr>(
190                                 const_cast<dom*>(this)->prev_tag());}
\end{verbatim}\end{Code}


\index{model::dom@{model::dom}!root@{root}}
\index{root@{root}!model::dom@{model::dom}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\bf{model::dom::ptr} model::dom::root ()}\label{classmodel_1_1dom_28209a3d9fbb5efeca89f96f5dd6aa72}


This method returns a pointer to the root-element of the current dom-tree. \begin{Desc}
\item[Returns:]A pointer to a dom-object is returned. \end{Desc}


Definition at line 93 of file dom.cpp.

\begin{Code}\begin{verbatim}94 {
95         if(node != 0) {
96                 iks *tmp = iks_root(node);
97                 return get_ptr(tmp);
98         }
99         return get_empty_ptr();
100 }
\end{verbatim}\end{Code}


\index{model::dom@{model::dom}!root@{root}}
\index{root@{root}!model::dom@{model::dom}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}const \bf{ptr} model::dom::root () const\hspace{0.3cm}{\tt  [inline]}}\label{classmodel_1_1dom_c139af49c26505717ba8fed25fba111b}


This method returns a pointer to the root-element of the current dom-tree. \begin{Desc}
\item[Returns:]A pointer to a dom-object is returned. \end{Desc}


Definition at line 158 of file dom.h.

\begin{Code}\begin{verbatim}158                                        {return static_cast<const ptr>(
159                                 const_cast<dom*>(this)->root());}
\end{verbatim}\end{Code}


\index{model::dom@{model::dom}!save@{save}}
\index{save@{save}!model::dom@{model::dom}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool model::dom::save (const string \& {\em filename}) const}\label{classmodel_1_1dom_85fea93a7589d88d94f5262c8a490956}


Stores the dom-tree into a file. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em filename}]is the file, in which the tree should be stored. \end{description}
\end{Desc}


Definition at line 295 of file dom.cpp.

\begin{Code}\begin{verbatim}296 {
297         if(node != 0) {
298                 iks* tmp = const_cast<iks*>(node);              // hack!
299                 return iks_save(filename.c_str(), tmp) == IKS_OK;
300         }
301         return false;
302 }
\end{verbatim}\end{Code}


\index{model::dom@{model::dom}!to_string@{to\_\-string}}
\index{to_string@{to\_\-string}!model::dom@{model::dom}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}string model::dom::to\_\-string () const}\label{classmodel_1_1dom_cec32c1d390ee77c4b52ab5c8a9ffc81}


Converts the dom-tree into a string. \begin{Desc}
\item[Returns:]A string is returned. \end{Desc}


Definition at line 283 of file dom.cpp.

\begin{Code}\begin{verbatim}284 {
285         if(node) {
286                 iks* hack = const_cast<iks*>(node);     // hack
287                 char *tmp = iks_string(0, hack);
288                 string rw = tmp;
289                 iks_free(tmp);
290                 return rw;
291         }
292         return "";
293 }
\end{verbatim}\end{Code}


\index{model::dom@{model::dom}!type@{type}}
\index{type@{type}!model::dom@{model::dom}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\bf{model::dom::node\_\-type} model::dom::type () const}\label{classmodel_1_1dom_ef60f281d2d1ae86a9035e6702c79e6c}


This method returns the type of the node. \begin{Desc}
\item[Returns:]The type of the node is returned. \end{Desc}


Definition at line 129 of file dom.cpp.

\begin{Code}\begin{verbatim}130 {
131         if(node == 0) {
132                 return TAG;
133         }
134         int tmp = iks_type(node);
135         switch(tmp) {
136                 case IKS_TAG:
137                         return TAG;
138                 break;
139                 case IKS_CDATA:
140                         return CDATA;
141                 break;
142                 case IKS_ATTRIBUTE:
143                         return ATTRIBUTE;
144                 break;
145                 default:
146                         return TAG;
147         }
148 }
\end{verbatim}\end{Code}




The documentation for this class was generated from the following files:\begin{CompactItemize}
\item 
model/dom.h\item 
model/dom.cpp\end{CompactItemize}
